xen/arm32: Invalidate BTB on guest exit for Cortex A17 and 12
authorJulien Grall <julien.grall@linaro.org>
Fri, 2 Feb 2018 14:19:23 +0000 (14:19 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 2 Feb 2018 19:35:00 +0000 (11:35 -0800)
commit05e0690d03dc6177e614e060ae78001d4f2abde2
tree64ed32a64d115832228814456ab47d9bf1d757e8
parent9bd4463b5c7cc026a07b9bbd41a6a7122a95647e
xen/arm32: Invalidate BTB on guest exit for Cortex A17 and 12

In order to avoid aliasing attackes agains the branch predictor, let's
invalidate the BTB on guest exist. This is made complicated by the fact
that we cannot take a branch invalidating the BTB.

This is based on the fourth version posted by Marc Zyngier on Linux-arm
mailing list (see [1]).

This is part of XSA-254.

[1] https://www.spinics.net/lists/arm-kernel/msg632062.html

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/arm32/entry.S
xen/arch/arm/cpuerrata.c